﻿<!--
	@create by 
	@update by 
	@description 
-->
<div>
	<el-form-q ref="queryForm" :field-data="queryFields" :buttons="queryButtons"></el-form-q>
  <div class="yu-toolBar">
  <el-button-group>
    <el-button icon="plus" @click="commitFn" v-if="checkPermission('commit')">提交</el-button>
    <el-button icon="edit" @click="createFn" v-if="checkPermission('create')">新增</el-button>
    <el-button icon="yx-file-excel" @click="exportFn" v-if="checkPermission('export')">导出</el-button>
    <el-button icon="check" @click="downloadFn" v-if="checkPermission('download')">模板下载</el-button>
    <el-button icon="yx-bin" @click="deleteFn" v-if="checkPermission('delete')">删除</el-button>
    <el-button icon="document" @click="infoFn" v-if="checkPermission('detail')">查看</el-button>

    <!--<el-button icon="plus" @click="testFn" >ODS测试1</el-button>-->
    <!--<el-button icon="plus" @click="test1Fn" >ODS测试2</el-button>-->
    <!--<el-button icon="plus" @click="test2Fn" >ODS测试3</el-button>-->

  </el-button-group>
  </div>

  <el-table-x ref="reftable" :row-index="true" :radiobox="false" :base-params="baseParams"
              :data-url="dataUrl" :table-columns="tableColumns" :request-type="'POST'"></el-table-x>
  <!-- 说明dialog可配置宽高属性，若不配置则宽度默认为屏幕50%，高度自适应
     width="650px" height="380px" -->
  <el-dialog-x title="导入产品白名单详情" :visible.sync="dialogVisible" width="100%" size="full">
      <el-tabs type="border-card" @tab-click="tabClick">
      <el-tab-pane label="通过白名单详情">
        <div class="yu-toolBar">
          <el-button-group>
            <el-button icon="plus" @click="tmpInfoFn('passtable')" >查看</el-button>
          </el-button-group>
        </div>
        <el-table-x ref="passtable" :row-index="true" :radiobox="false" :base-params="passBaseParams" :default-load="false"
                    :data-url="temdataUrl" :table-columns="temtableColumns" :table-filters="tableFilters" :request-type="'POST'"></el-table-x>
      </el-tab-pane>
      <el-tab-pane label="未通过白名单详情">
        <div class="yu-toolBar">
        <el-button-group>
          <!--<el-button icon="yx-bin" @click="temdeleteFn" v-if="checkPermission('delete')">删除</el-button>-->
          <el-button icon="plus" @click="tmpInfoFn('temreftable')" >查看</el-button>
        </el-button-group>
        </div>
        <el-table-x ref="temreftable" :row-index="true" :radiobox="false" :base-params="temBaseParams" :default-load="false"
                  :data-url="temdataUrl" :table-columns="temtableColumns" :table-filters="tableFilters" :request-type="'POST'"></el-table-x>
      </el-tab-pane>

      <el-tab-pane label="批次内容详情">
        <el-form-x ref="reform"
                   :group-fields="updateFields"  :disabled="formDisabled" label-width="80px">
        </el-form-x>
      </el-tab-pane>
    </el-tabs>
  </el-dialog-x>
  <el-dialog-x title="新增产品白名单" :visible.sync="createDialogVisible" width="70%" v-loading="loading2" element-loading-text="上传中" >
    <el-form-x ref="createForm" :group-fields="createFields" label-width="80px">
    </el-form-x>
    <!--<el-upload  ref="upload" :action="uploadUrl" :show-file-list="true" :auto-upload="false" :multiple="false" :on-change="changeFile"
                :on-success="successUpload" :on-error="errorUpload" :before-upload="beforeAvatarUpload" :data="uploadData"
                accept="application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">
      <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
      <el-button style="margin-left: 400px" size="middle" type="success" @click="submitUpload" icon="check">保存</el-button>
      <el-button size="middle" type="primary" @click="cancelFn" icon="yx-undo2">取消</el-button>
      <div slot="tip" class="el-upload__tip">只能够上传excel类型的文件</div>
    </el-upload>-->

    <div class="el-table el-table--fit el-table--striped el-table--border el-table--enable-row-hover el-table--enable-row-transition">
      <div class="el-table__header-wrapper">
        <table class="el-table el-table__header">
          <thead>
          <tr>
            <th>序号</th>
            <th>文件名</th>
          </tr>
          </thead>
          <tbody>
          <tr v-for="(file, index) in files" :key="file.id">
            <td>{{index + 1}}</td>
            <td>
              <div class="filename">
                {{file.name}}
              </div>
            </td>
          </tr>
          </tbody>
        </table>
      </div>
    </div>
    <div class="yu-toolBar" style="text-align: center;margin-top: 20px;">
      <el-button-group>
        <file-upload class="el-button" :post-action="uploadUrl" :extensions="extensions" :data="fileData" :headers="headers" v-model="files"
                     accept="application/vnd.ms-excel,application/x-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
                @input-filter="inputFilter"  @input-file="inputFile" ref="upload">
          <i class="fa fa-plus"></i>
          选择文件
        </file-upload>
        <el-button style="padding-left: 10px" icon="yx-file-excel"  @click="commitFileFn">保存</el-button>
        <el-button style="padding-left: 10px" icon="yx-bin"  @click="closeFn">关闭</el-button>
      </el-button-group>
    </div>
  </el-dialog-x>

  <el-dialog-x title="白名单详情" :visible.sync="wbDialogVisible" size="full">
    <el-form-x ref="wbForm" :buttons="wbButtons" :group-fields="wbFields" :disabled="wbDisabled" label-width="80px">
    </el-form-x>
  </el-dialog-x>

</div>
